
const showNav = function (cname){
    let nav = document.createElement('nav');
    nav.className = `nav`
    nav.innerHTML = `
        <a class="${cname === 'home' ? 'active': ''}" href="./home.html">
            <span class="iconfont icon-shouye"></span>
            首页
        </a>

        <a class="${cname === 'sports' ? 'active': ''}"  href="./running.html">
            <span class="iconfont icon-yundong"></span>
            运动
        </a>

        <a class="${cname === 'circle' ? 'active': ''}"  href="./circle.html">
            <span class="iconfont icon-quanzi"></span>
            圈子
        </a>
        <a class="${cname === 'my' ? 'active': ''}"  href="./my.html">
            <span class="iconfont icon-wode"></span>
            我的
        </a>
    `
    document.body.append(nav)

}

module.exports = {
    showNav
}